package com.lebo.portal.web.data.converter;

import java.math.BigDecimal;

import org.springframework.core.convert.converter.Converter;

import com.lebo.portal.constant.Constants;

public class StringToBigDecimalConverter implements Converter<String,BigDecimal> {

    @Override
    public BigDecimal convert(String source) {
        BigDecimal amount = new BigDecimal(Double.valueOf(source)).setScale(Constants.MONEY_PRECISION);
        return amount;
    }
}
